<template>
	<view class="container">
		<uni-icons type="left"></uni-icons>
		<text class="iconfont iconcx-Dwuti"></text>
		<text class="iconfont iconcx-chongwutijian"></text>
		<view class="test">
			<button type="primary" @click="handleHttp">handleHttp</button>
		</view>
		<button type="default" @click="handleRouter('swiper')">swiper</button>
		<button type="primary" @click="handleRouter('scrollView')">scrollView</button>
		<text>{{JSON.stringify(result)}}</text>
	</view>
</template>

<script>
	import {
		getGoodsList
	} from '@/apis/goods.js'
	export default {
		data() {
			return {
				result: []
			}
		},

		methods: {
			handleHttp() {
				uni.showLoading({
					title: 'loading...'
				})
				getGoodsList().then(res => {
						console.log('res', res);
						this.result=res.list
						console.log(this.result);
					})
					.catch((err) => {
						console.log('0000catch', err);
					})
					.finally(() => {
						uni.hideLoading()
					})
			},
			
			//路由跳转
			handleRouter(path){
				uni.navigateTo({
					url:'/pagesA/homeChilds/'+path
				})
			}
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
</style>
